#上一帧时间戳 = 0
self.onmessage = ({data:[ppi,读,写,x,y,宽,高]})=>
  宽 *= ppi
  高 *= ppi

  实高 = 高 #* 2
  实宽 = 宽 #* 2

  ###
  radio = 9437184 / (实宽* 实高)
  if radio < 1
    实宽 = parseInt 实宽*radio
    实高 = parseInt 实高*radio
  ###

  x *= ppi
  y *= ppi

  canvas = new OffscreenCanvas(实宽,实高) # 切图展示区域的大小
  #canvas.captureStream 24
  ctx = canvas.getContext("2d", {
    alpha: false
    desynshronized: true
    #preserveDrawingBuffer:true
  })
  #n = 0
  读.pipeThrough(
    new TransformStream({
      transform:(frame, controller) =>
        {timestamp} = frame
        #console.log frame
        # https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/drawImage
        #if (timestamp - 上一帧时间戳) > 60000
        #  上一帧时间戳 = timestamp
          #if n++ % 24 == 0
          #  console.log timestamp/1000
        ctx.drawImage(
          frame
          x
          y
          宽
          高
          0
          0
          实宽
          实高
        )
        controller.enqueue(
          new VideoFrame(
            canvas
            {
              timestamp
            }
          )
        )
        frame.close()
        return
    })
  ).pipeTo(写)
  return
